WinMerge plugins are custom dlls or scriptlets, written in the COM API, that preprocess data before a comparison. For example, you can use a plugin to extract text data from MS Word files for WinMerge to compare. Plugins are not included when you install WinMerge, either because the functions that they provide are of interest to only a few users, or because they do not fit into the WinMerge architecture.
A single dll or a scriptlet (sct
) file
Installed in the MergePlugins
subfolder. A number of plugins are installed for you by WinMerge.
Easy to install: To install a plugin that is not included in the
WinMerge installation, just copy the plugin file to MergePlugins
. The plugin is available the
next time you open WinMerge.
Plugins are grouped into three main categories:
This type of plugin performs custom operations on selected text in the active editor (File pane) of the File Compare window.
This type of plugin transforms a compressed file to a viewable format by decompressing it. The original file is not changed: a temporary transformed file is created and loaded in WinMerge.
Unpacker plugins operate on entire files, not to selected text or diffs within files. Therefore, they are available only when you launch file comparisons, from either the Folder Compare window or the Select Files or Folders dialog. Unpacker plugins are not available in the File Compare window.
Sometimes the unpacked file can be repacked (see the details in Available plugins to check whether a plugin supports repacking). Then, you can merge and save the transformed file. The packing is done automatically in this case. To be safe, we suggest that you rename the transformed file when you save it.
Note | |
---|---|
When you compare folders, WinMerge can give different results for compressed and uncompressed files. For example, files that are identical when uncompressed might be different if they include the creation date. WinMerge applies the unpacker in all situations, and you are sure to have the same result when you compare a folder, or when you merge two versions of a file. |
Example plugin: DisplayXMLFiles.dll reformats XML files for readability.
This type of plugin does not operate on the source files displayed in the Compare window. It operates instead on temporary copies of the files, and the copies are then scanned to create the difference list.
Example plugin: IgnoreColumns.dll ignores the differences inside specified columns, while displaying the characters in these columns.
How is WinMerge able to apply the right plugin for a given file? Each plugin specifies a list of file extensions (also listed in each plugin's Available plugins section, under File filter). The extensions are used to associate one or more file types with the plugin: when a compared file's extension matches an extension in the plugin's list, the plugin is considered to be a suggested plugin.
There are separate WinMerge options for the unpacking and prediffer types, described later in this topic, that enable you to apply the plugins either manually or automatically. There is no automatic mode for editor complement plugins.
When you apply plugins to a selected file using automatic mode, WinMerge searches its list of suggested plugins for that file type, and applies the first plugin whose name matches. The search is performed in alphabetical order, so if there are multiple suggested plugins for a file type, only the first one found is applied.
The following subsections describe how to apply each type of plugin. The methods are different for each type of plugin, and also vary depending on whether you are comparing folders or files.
With your cursor in either File pane of the File Compare window, click
→ and choose one of these functions:MakeUpper
MakeLower
InsertDate
InsertTime
The functions are contributed to the editor addin.sct and insert datetime.sct plugins.
menu by theNote | |
---|---|
Editor complement plugins are not available in the Folder Compare window. |
Before applying unpacker plugins, you can set its mode to either automatic or manual mode.
To set automatic mode for this type of plugin, click
→ .To set manual mode, click
→ .Remember to click F5 to reload the Folder Compare window using the new setting.
To apply plugins when automatic unpacking is set, simply launch a compare operation on a file in the Folder Compare window. If the file's type suggested unpacker plugin (if any) preprocesses the file before WinMerge opens it in the File Compare window.
For example, suppose you right-click an MS Word
doc
file and choose
(also assume that the CompareMSWordFiles.dll plugin is available). WinMerge converts the
doc file (or rather, a copy of it ) to a plain text file and opens it in
the File Compare window.
Manual mode enables you to choose a different unpacker plugin than the one that is selected for you in automatic mode. You can also launch the compare using no plugin.
To apply plugins when manual unpacking is set:
Select the file you want to compare.
Click
→ .This menu item is enabled only if the selected file's type is supported by an available unpacking plugin.
In the Select Unpacker dialog:
Configure automatic plugin selection or choose a plugin manually:
To use automatic mode (which applies the first available plugin), verify that <None> is displayed in the the File unpacker control.
To choose a different plugin (if available), use the File unpacker control to choose the plugin.
By default, this control lists only suggested plugins for the file type you selected to compare. To see all available plugins, enable the option, Display all packers, don't check the extension.
To launch the compare without using any plugin, choose File unpacker control.
in theClick
to close the Select Unpacker dialog.Click
to close the Select Unpacker dialog and launch the file comparison.You can use the Select Unpacker dialog to apply a plugin when you launch a file comparison from the Select Files or Folders dialog. See Selecting an unpacker for file comparisons for details.
With prediffer plugins, you set the mode (Auto prediiffer or No prediffer) for individual files. (Contrast this with unpacker plugins, where you set the mode for all files.) That is, some files in the same folder have different prediffer modes.
To set the mode for one or more files in the Folder Compare window, right-click the files and choose
→ , then choose one of the submenu options:selects the first prediffer plugin available for the file type.
means that no prediffer plugin is used.
Click F5 to update the window.
Note | |
---|---|
When you open a subfolder during a non-recursive compare, the mode is always reset to . |
When you open a file from the Folder Compare window, your prediffer setting for that file is applied before the File Compare window is opened.
In the File Compare winodw, you can apply a prediffer plugin by clicking
→ and choosing one of the plugins in the list. Suggested plugins are indicated at the top of the list. The files are compared again after the plugin is applied, so you don't need to rescan the files.Displays the text contents of a Microsoft® Excel file, stripping away all formatting and embedded objects.
*.xls
Displays the text content of a Microsoft® Word file, stripping away all formatting and embedded objects.
*.doc
, *.dot
This plugin pretty-prints XML files nicely by inserting tabs and line breaks. This is useful for XML files that do not have line returns in convenient locations.
*.xml
Adds two functions to the
→ menu:This plugin ignores characters at specified columns. The first column is number 1
Note that this plugin does not support files with tabs: the plugin does not fail, but all tabs are be treated as normal characters.
To specify columns, rename the dll
using
following fields as parameters:
Example 1. IgnoreColumns.dll
examples
IgnoreColumns _ 3 _ 10 - 20 _ 32 -
33.dll
IgnoreColumns_1,30 to 40.dll
*.txt
The plugin ignores comments within //
... and
/*
... */
delimiters in C, C++,
PHP and JavaScript files.
*.cpp
, *.cxx
, *.h
, *.hxx
, *.c
, *.php
, *.js
,
This plugin is for files with fields and commas as delimiters (CSV files, for example). It ignores the delimiter characters. The first field is number 1.
To specify the delimiters, rename the dll
using
the same parameter fields used for IgnoreColumns.dll.
*.csv
This plugin is for files that use fields and tabs as delimiters
(for examle, Excel files saved in the *.txt
format). It ignores the delimiter
characters. The first field is number 1.
To specify the delimiters, rename the dll
using
the same parameter fields used for IgnoreColumns.dll.
*.txt
This plugin ignores the leading line numbers in text files (for example, NC and BASIC files).
Adds two functions to the
→ menu:This plugin preprocesses RC files by stripping out localized strings, to enable comparing different language versions of the same RC file and ignoring the translations.
RCLocalizationHelperU.dll
is the Unicode
version.
*.rc
For long LOG files, often only in the first lines or in the last lines are significant.
WatchBeginningOfLog.dll
truncates the
files to the first 1/10th.
WatchEndOfLog.dll
truncates the files to
the first 1/10th.
*.log
Developers can find information and code examples in the source
package, under the Plugins
folder.
Some editor complement plugins require this optional component from Microsoft®.
If the list of editor complements does not include all editor plugins, this component is probably missing. To help you verify, WinMerge displays a comment at the bottom of the list. You can install WSH on any version of Windows Download it from MSDN Library, using IE 4.0 or later.
Some plugins require the Visual Basic runtime library to work.
You can download the required file msvbvm60.dll
,
or use the Run-Time
Redistribution Pack from Microsoft®. If you don't need the plugin,
you can safely remove it.